package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.station.dto.EnterpriseDto;
import com.shensi.api.admin.domian.station.dto.UploadWxImgDto;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface EnterpriseClient {

    /**
     * 查询油企名，油站名
     */
    @GetMapping("/enterprise/info/getEnterpriseandStation")
    public AjaxResult getEnterpriseandStation();


    /**
     * 查询油站信息列表
     */
    @GetMapping("/enterprise/info/list")
    public TableDataInfo list(@SpringQueryMap @Valid EnterpriseDto enterprise);

    /**
     * 逻辑删除
     */
    @PostMapping(value = "/enterprise/info/deleteEnterprise")
    public AjaxResult deleteEnterprise(@RequestBody EnterpriseDto enterprise);


    /**
     * 创建微信卡卷
     */
    @PostMapping(value = "/enterprise/info/createCardEnterprise")
    public AjaxResult createCardEnterprise(@RequestBody EnterpriseDto enterprise);


    /**
     * 修改优惠卷开启状态的标识
     */
    @PostMapping(value = "/enterprise/info/updateCouponEnabledFlag")
    public AjaxResult updateCouponEnabledFlag(@RequestBody String flag);

    /**
     * 新增油企
     */
    @PostMapping("/enterprise/info")
    public AjaxResult add(@RequestBody EnterpriseDto enterprise);


    /**
     * 获取油站信息详细信息
     */
    @GetMapping(value = "/enterprise/info/{enterpriseId}")
    public AjaxResult getInfo(@PathVariable("enterpriseId") Long enterpriseId);

    /**
     * 修改油站信息
     */
    @PutMapping("/enterprise/info")
    public AjaxResult edit(@RequestBody EnterpriseDto enterprise);


    /**
     * 查询油企的选项
     */
    @GetMapping("/enterprise/info/listOption")
    public TableDataInfo listOption(@SpringQueryMap EnterpriseDto enterprise);

    /**
     * 查询油企是否有appid
     */
    @PostMapping("/enterprise/info/selectEnterpriseAppid")
    public AjaxResult selectEnterpriseAppid(Long enterpriseId);

    @PostMapping("/enterprise/info/updateMenuBar")
    public AjaxResult updateMenuBar(@RequestBody String requestBody);

    @GetMapping("/enterprise/info/getMenuBar")
    public AjaxResult getMenuBar() ;

    @GetMapping("/enterprise/info/getGzhStatus")
    public AjaxResult gzhStatus(@RequestParam("enterpriseId") String enterpriseId);

    @PostMapping("/enterprise/info/updateCardInfo")
    public AjaxResult updateCardInfo(@RequestParam("enterpriseId") String enterpriseId);

    @GetMapping("/enterprise/info/getLinkedMiniProgram")
    public AjaxResult getLinkedMiniProgram();

    @PostMapping("/enterprise/info/uploadImgToWx")
    public AjaxResult uploadImgToWx(@RequestBody UploadWxImgDto uploadWxImgDto);

}
